<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>shark::CanBeCalled&lt; Functor, Argument &gt; Struct Template Reference</title>
<script type="text/javaScript" src="search/search.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3.0.1/es5/tex-mml-chtml.js"></script>
<script src="../../mlstyle.js"></script>
<link href="../css/besser.css" rel="stylesheet" type="text/css"/>
</head>
<!-- pretty cool: each body gets an id tag which is the basename of the web page  -->
<!--              and allows for page-specific CSS. this is client-side scripted, -->
<!--              so the id will not yet show up in the served source code -->
<script type="text/javascript">
    jQuery(document).ready(function () {
        var url = jQuery(location).attr('href');
        var pname = url.substr(url.lastIndexOf("/")+1, url.lastIndexOf(".")-url.lastIndexOf("/")-1);
        jQuery('#this_url').html('<strong>' + pname + '</strong>');
        jQuery('body').attr('id', pname);
    });
</script>
<body>
    <div id="shark_old">
        <div id="wrap">
            <div id="header">
                <div id="site-name"><a href="../../sphinx_pages/build/html/index.html">Shark machine learning library</a></div>
                <ul id="nav">
                    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/installation.html">Installation</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/tutorials/tutorials.html">Tutorials</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/benchmark.html">Benchmarks</a>
                    </li>
                    <li class="active">
                        <a href="classes.html">Documentation</a>
                        <ul>
                            <li class="first"></li>
                            <li><a href="../../sphinx_pages/build/html/rest_sources/quickref/quickref.html">Quick references</a></li>
                            <li><a href="classes.html">Class list</a></li>
                            <li class="last"><a href="group__shark__globals.html">Global functions</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </div>
<div id="doxywrapper">
<!--
    <div id="global_doxytitle">Doxygen<br>Documentation:</div>
-->
    <div id="navrow_wrapper">
<!-- Generated by Doxygen 1.9.8 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceshark.html">shark</a></li><li class="navelem"><a class="el" href="structshark_1_1_can_be_called.html">CanBeCalled</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="structshark_1_1_can_be_called-members.html">List of all members</a> &#124;
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a>  </div>
  <div class="headertitle"><div class="title">shark::CanBeCalled&lt; Functor, Argument &gt; Struct Template Reference</div></div>
</div><!--header-->
<div class="contents">

<p>detects whether Functor(Argument) can be called.  
 <a href="structshark_1_1_can_be_called.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_can_be_called_8h_source.html">shark/Core/utility/CanBeCalled.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-static-attribs" name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:afcd8fe84c968364924b1d5870905a3d5" id="r_afcd8fe84c968364924b1d5870905a3d5"><td class="memItemLeft" align="right" valign="top">static bool const&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structshark_1_1_can_be_called.html#afcd8fe84c968364924b1d5870905a3d5">value</a></td></tr>
<tr class="separator:afcd8fe84c968364924b1d5870905a3d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><div class="compoundTemplParams">template&lt;class Functor, class Argument&gt;<br />
struct shark::CanBeCalled&lt; Functor, Argument &gt;</div><p>detects whether Functor(Argument) can be called. </p>
<p>Suppose you have a general Functor. It might take several arguments, some more suited for your computation than others. In this case one may want to check, which input argument may work. The exact implementation and inner workings are outlined in <a href="http://www.boost.org/doc/libs/1_52_0/doc/html/proto/appendices.html">http://www.boost.org/doc/libs/1_52_0/doc/html/proto/appendices.html</a> the trick is to generate a functor F2 from our supplied functor, such that F2(arg) is always a valid expression, but at the same time F2(arg) and F(arg) have clearly distinguishable return types. There are a few tricks needed for the case that F(arg) has return type void. </p>

<p class="definition">Definition at line <a class="el" href="_can_be_called_8h_source.html#l00052">52</a> of file <a class="el" href="_can_be_called_8h_source.html">CanBeCalled.h</a>.</p>
</div><h2 class="groupheader">Member Data Documentation</h2>
<a id="afcd8fe84c968364924b1d5870905a3d5" name="afcd8fe84c968364924b1d5870905a3d5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afcd8fe84c968364924b1d5870905a3d5">&#9670;&#160;</a></span>value</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Functor , class Argument &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool const <a class="el" href="structshark_1_1_can_be_called.html">shark::CanBeCalled</a>&lt; Functor, Argument &gt;::value</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">= (</div>
<div class="line">            <span class="keyword">sizeof</span>(no_type) == <span class="keyword">sizeof</span>(is_private_type( (m_fun(m_arg), 0) ))</div>
<div class="line">        )</div>
</div><!-- fragment -->
<p class="definition">Definition at line <a class="el" href="_can_be_called_8h_source.html#l00082">82</a> of file <a class="el" href="_can_be_called_8h_source.html">CanBeCalled.h</a>.</p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>include/shark/Core/utility/<a class="el" href="_can_be_called_8h_source.html">CanBeCalled.h</a></li>
</ul>
</div><!-- contents -->
</div>
</body>
</html>
